package com.daiyang.librarymanagementsystem2.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/user")
public class UserContrller {
    @RequestMapping("/login")
    public boolean login(String name, String password) {
        log.info("name:{}",name);
        log.info("password:{}",password);
        if(!StringUtils.hasLength(name) && !StringUtils.hasLength(password)) {
            return false;
        }
        if("admin".equals(name) && "admin".equals(password)) {
            return true;
        }
        return false;
    }
}
